<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------

namespace app\user_center\validate\mcn;

use think\Validate;

/**
 * 公共类 验证器
 * @package app\admin\validate
 * @author jason wang <120907037@qq.com>
 */
class Mcn extends Validate
{
    protected $rule = [
        'user_id'       	=>  'number|require|gt:0|behavior:\app\user_center\behavior\common\checkUserId', 	 		//user_id 数字/必填/大于0
        'attestation_id'    =>  'number|require|gt:0|behavior:\app\user_center\behavior\common\checkAttestationId', 	 		//attestation_id 数字/必填/大于0
        'artist_id'    		=>  'number|require|gt:0|behavior:\app\user_center\behavior\common\checkArtistId', 	 		//artist_id 数字/必填/大于0
        'artist_mobile'    	=>  'require|mobile',//artist_mobile 数字/必填/大于0/11位
        'artist_name'    	=>  'require',						//artist_name 	必填
        'artist_status'    	=>  'number|require|in:0,1',			//artist_status 数字/必填/大于等于0
    ];

    // protected $message  =   [
    //     'user_id' 			=> 'user_id格式错误',
    //     'attestation_id' 	=> 'attestation_id格式错误',
    //     'artist_id' 		=> 'artist_id格式错误',
    //     'artist_mobile' 	=> '手机号码格式错误',
    //     'artist_name' 		=> '艺人名称不能为空',
    //     'artist_status' 	=> 'artist_status格式错误',
    // ];

    //验证场景
    protected $scene = [
        					'artist_list'   =>  [//艺人列表
													'user_id',
													//'attestation_id',
												],
							'add_artist'    =>  [//添加艺人
													'user_id',
													//'attestation_id',
													'artist_mobile',
													'artist_name',
													'artist_status',
												],
							'edit_artist'    =>  [//编辑艺人
													'user_id',
													//'attestation_id',
													'artist_id',
													'artist_mobile',
													'artist_name',
													'artist_status',
												],
							'delete_artist'   =>  [//删除艺人
													'user_id',
													'artist_id',
												],
							'get_artist_info'   =>  [//艺人详情
													'user_id',
													'artist_id',
												],

               			];
}
